package com.ruoyi.qiushi.service.followup.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.qiushi.domain.followup.QiushiFollowRecord;
import com.ruoyi.qiushi.mapper.followup.QiushiFollowRecordMapper;
import com.ruoyi.qiushi.service.followup.IQiushiFollowRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 随访记录Service业务层处理
 *
 * @author ruoyi
 * @date 2024-01-20
 */
@Service
public class QiushiFollowRecordServiceImpl implements IQiushiFollowRecordService {
    @Autowired
    private QiushiFollowRecordMapper qiushiFollowRecordMapper;

    /**
     * 查询随访记录
     *
     * @param id 随访记录主键
     * @return 随访记录
     */
    @Override
    public QiushiFollowRecord selectQiushiFollowRecordById(Long id) {
        return qiushiFollowRecordMapper.selectQiushiFollowRecordById(id);
    }

    /**
     * 查询随访记录列表
     *
     * @param qiushiFollowRecord 随访记录
     * @return 随访记录
     */
    @Override
    public List<QiushiFollowRecord> selectQiushiFollowRecordList(QiushiFollowRecord qiushiFollowRecord) {
        return qiushiFollowRecordMapper.selectQiushiFollowRecordList(qiushiFollowRecord);
    }

    /**
     * 新增随访记录
     *
     * @param qiushiFollowRecord 随访记录
     * @return 结果
     */
    @Override
    public int insertQiushiFollowRecord(QiushiFollowRecord qiushiFollowRecord) {
        qiushiFollowRecord.setCreateTime(DateUtils.getNowDate());
        return qiushiFollowRecordMapper.insertQiushiFollowRecord(qiushiFollowRecord);
    }

    /**
     * 修改随访记录
     *
     * @param qiushiFollowRecord 随访记录
     * @return 结果
     */
    @Override
    public int updateQiushiFollowRecord(QiushiFollowRecord qiushiFollowRecord) {
        qiushiFollowRecord.setUpdateTime(DateUtils.getNowDate());
        return qiushiFollowRecordMapper.updateQiushiFollowRecord(qiushiFollowRecord);
    }

    /**
     * 批量删除随访记录
     *
     * @param ids 需要删除的随访记录主键
     * @return 结果
     */
    @Override
    public int deleteQiushiFollowRecordByIds(Long[] ids) {
        return qiushiFollowRecordMapper.deleteQiushiFollowRecordByIds(ids);
    }

    /**
     * 删除随访记录信息
     *
     * @param id 随访记录主键
     * @return 结果
     */
    @Override
    public int deleteQiushiFollowRecordById(Long id) {
        return qiushiFollowRecordMapper.deleteQiushiFollowRecordById(id);
    }
}
